<?php

defined('MYLITS') ? '' : exit('No direct script access allowed');

/**
 * @version     1.0.0
 * @package     mylits engine
 * @license     GNU General Public License version 3
 * @author      Arfan Fudyartanto D N <arfan@mylits.com> - http://engine.mylits.com
 */
class widgetProcess extends Mylits_Process {

    public function __construct() {
        parent::__construct();
        $this->setTemplate('widget');
        $this->loadHelper('menu');
        $this->model = $this->loadModel('menus');
    }

    public function response() {
        if (isset($this->widget_id)) {
            $menuId = $this->widget_id;
            $lang = Mylits_Language::getInstance();
            $langCode = $lang::getLangCode();

            $menus = $this->model->getMenuItemList($menuId, $langCode);
            return compact('menus');
        }
    }

}

?>
